import { IPSDEWizard } from './ipsdewizard';
import { IPSDEWizardForm } from './ipsdewizard-form';
import { IPSDEWizardStep } from './ipsdewizard-step';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEWizardFormImpl extends PSModelObjectImpl implements IPSDEWizardForm {
  protected cm2pslanguageres: IPSLanguageRes | null = null;

  getCM2PSLanguageRes(): IPSLanguageRes | null {
    if (this.cm2pslanguageres != null) return this.cm2pslanguageres;
    const value = this.M.getCM2PSLanguageRes;
    if (value == null) {
      return null;
    }
    this.cm2pslanguageres = this.getPSModel4('res.IPSLanguageRes', value, 'getCM2PSLanguageRes') as IPSLanguageRes;
    return this.cm2pslanguageres;
  }

  get cM2PSLanguageRes(): IPSLanguageRes | null {
    return this.getCM2PSLanguageRes();
  }

  getCM2PSLanguageResMust(): IPSLanguageRes {
    const value = this.getCM2PSLanguageRes();
    if (value == null) {
      throw new Error('未指定下一步确认信息2语言资源');
    }
    return value;
  }

  protected cmpslanguageres: IPSLanguageRes | null = null;

  getCMPSLanguageRes(): IPSLanguageRes | null {
    if (this.cmpslanguageres != null) return this.cmpslanguageres;
    const value = this.M.getCMPSLanguageRes;
    if (value == null) {
      return null;
    }
    this.cmpslanguageres = this.getPSModel4('res.IPSLanguageRes', value, 'getCMPSLanguageRes') as IPSLanguageRes;
    return this.cmpslanguageres;
  }

  get cMPSLanguageRes(): IPSLanguageRes | null {
    return this.getCMPSLanguageRes();
  }

  getCMPSLanguageResMust(): IPSLanguageRes {
    const value = this.getCMPSLanguageRes();
    if (value == null) {
      throw new Error('未指定下一步确认信息语言资源');
    }
    return value;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get confirmMsg(): string {
    return this.M.confirmMsg;
  }

  get confirmMsg2(): string {
    return this.M.confirmMsg2;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get formTag(): string {
    return this.M.formTag;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  get psDEFormName(): string {
    return this.M.getPSDEFormName;
  }

  getPSDEFormName(): string {
    return this.M.getPSDEFormName;
  }

  protected psdewizardstep: IPSDEWizardStep | null = null;

  getPSDEWizardStep(): IPSDEWizardStep | null {
    if (this.psdewizardstep != null) return this.psdewizardstep;
    const value = this.M.getPSDEWizardStep;
    if (value == null) {
      return null;
    }
    const ipsdewizard = this.getParentPSModelObject('dataentity.wizard.IPSDEWizard') as IPSDEWizard;
    if (ipsdewizard != null) {
      this.psdewizardstep = ipsdewizard.findPSDEWizardStep(value);
    }
    return this.psdewizardstep;
  }

  get psDEWizardStep(): IPSDEWizardStep | null {
    return this.getPSDEWizardStep();
  }

  getPSDEWizardStepMust(): IPSDEWizardStep {
    const value = this.getPSDEWizardStep();
    if (value == null) {
      throw new Error('未指定向导步骤对象');
    }
    return value;
  }

  protected stepactions: string[] | null = null;

  getStepActions(): string[] | null {
    if (this.stepactions == null) {
      const value = this.M.stepActions;
      if (value == null) {
        return null;
      }
      const arrayNode: any[] = value;
      if (arrayNode.length == 0) {
        return null;
      }
      const list: string[] = [];
      for (let i = 0; i < arrayNode.length; i++) {
        list.push(arrayNode[i]);
      }
      this.stepactions = list;
    }
    return this.stepactions;
  }

  get stepActions(): string[] | null {
    return this.getStepActions();
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get firstForm(): boolean {
    return this.M.firstForm;
  }

  get cls(): string {
    return 'PSDEWizardFormImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'dataentity.wizard.IPSDEWizardForm') return true;
    return super.instanceof(cls);
  }
}
